/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package IRS.Domains;

/**
 *
 * @author LinYi
 */
public class Phrase {
    private int rank;
    private String word1;
    private String word2;
    
    public Phrase (String word1, String word2) {
        this.word1 = word1;
        this.word2 = word2;
        this.rank = 0;
    }
    
    public void setRank(int rank) {
        this.rank = rank;
    }
    
    public String getWord1(){
        return this.word1;
    }
    
    public String getWord2() {
        return this.word2;
    }
    
    public void addRank() {
        this.rank ++;
    }
    
    public Integer getRank(){
        return this.rank;
    }

    public void reduceRank() {
        this.rank --;
    }

    public boolean hasWord(String word) {
        return (this.word1.equals(word) || this.word2.equals(word));
    }
    
}
